package model

import (
	"gorm.io/gorm"
	__ "videosS_rpc/basic/proto"
)

type Member struct {
	gorm.Model
	MemberName    string `gorm:"type:varchar(20);commit:黄金VIP/星钻VIP"`
	Duration      int    `gorm:"type:int;commit:1:1个月/2:3个月/3:12个月"`
	Price         string `gorm:"type:varchar(20);commit:原价"`
	DiscountPrice string `gorm:"type:varchar(20);commit:优惠原价"`
	Instructions  string `gorm:"type:varchar(200);commit:权益说明"`
}

func (m *Member) MemberAdd(DB *gorm.DB) error {
	var err error
	err = DB.Create(&m).Error
	return err
}

func (m *Member) MemberList(DB *gorm.DB) (list []*__.MemberList, err error) {
	err = DB.Model(&m).Find(&list).Error
	return list, err
}
